package Exercicios;

public class TestSeven extends Thread{

	private static int x;

	public static synchronized void doThings() {

		int current = x;
		current++;
		x = current;
		System.out.println(x);

	}

	void waitForSignal() {
		Object obj = new Object();
		synchronized (Thread.currentThread()) {
			try {
				obj.wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			obj.notify();
		}
	}
	public synchronized void run() {
		doThings();
	}

    public static void main(String[] args) {
    	TestSeven t = new TestSeven();
    	t.start();
	}
}
